<HTML><HEAD><TITLE>max_weight(?Svar, ?Var)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(conjunto)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>max_weight(?Svar, ?Var)</H1>
Svar is a weighted set domain variable whose maximal possible weight
attached to an element is Var.


<DL>
<DT><EM>?Svar</EM></DT>
<DD>A weighted set domain variable or a weighted set.
</DD>
<DT><EM>?Var</EM></DT>
<DD>Term unifying with a term of the form e(_,_).
</DD>
</DL>
<H2>Description</H2>
   If Svar is a weighted set domain variable, it returns the element of its
   domain which belongs to the set resulting from the difference of the
   upper bound and the lower bound and which has the greatest weight.  If
   Svar is a ground set, it just returns the element with the geratest
   weight.

<P>

<H3>Fail Conditions</H3>
   Fails if Svar is not a weighted set term, or if Var can not be unified
   with the extracted element.


<H3>Resatisfiable</H3>
   No.
<H2>Examples</H2>
<PRE>
[eclipse 4]: S `:: {e(a,10), e(b,15)} ..{e(a,10), e(b,15),
 e(c,20)},  max_weight(S,W).

S = S{{e(a, 10), e(b, 15)} .. {e(a, 10), e(b, 15), e(c, 20)}}
W = e(c, 20)
yes.



</PRE>
<H2>See Also</H2>
<A HREF="../../lib/conjunto/BNN-2.html">`:: / 2</A>
</BODY></HTML>
